package com.cdc.servlet7;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Servlet7 extends HttpServlet {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7718028916044688607L;
	//protected void doGet(HttpServletRequest request, HttpServletResponse response)
   // throws ServletException, IOException {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        ServletContext context = getServletContext();
        Enumeration<String> e = context.getInitParameterNames();
        String str = "";
        while (e.hasMoreElements()) {
            str = e.nextElement();
            out.print("<br> " + context.getInitParameter(str));
        }
        String driverName = context.getInitParameter("dname");
        out.print("driver name is = <b>'" + driverName+"'</b>");
        out.print("</br>");
        out.close();
	}

}
